OSes with 64bit file i/o and LP64 model *must* have lseek prototyped...
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 19 Jan 2004 18:15:22 +0000 (18:15 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 19 Jan 2004 18:15:22 +0000 (18:15 +0000)
gpsbabel/coldsync/pdb.c

index e30e725ba5f4c7829f43c83c1b710935fd2cecbf..b7d4f9807f72d0da79f54c697a92fe50ae2cb5b3 100644 (file)
@@ -6,7 +6,7 @@
  *     You may distribute this file under the terms of the Artistic
  *     License, as specified in the README file.
  *
- * $Id: pdb.c,v 1.4 2004-01-18 01:24:41 robertl Exp $
+ * $Id: pdb.c,v 1.5 2004-01-19 18:15:22 robertl Exp $
  */
 /* XXX - The way zero-length records are handled is a bit of a kludge. They
  * shouldn't normally exist, with the exception of expunged records. But,
 #include <stdio.h>
 #include <fcntl.h>             /* For open() */
 #include <sys/types.h>
+/*
+ * Unistd.h (indeed, read, write, and lseek) are not part of ISO C.
+ * Systems may not have unistd.h.  While the below is tacky, Windows
+ * is the only system that we care about that has lseek and friends 
+ * but doesn't have it prototyped.  Systems with 64-bit file I/O but
+ * based on LP64 model (i.e. OS/X) _require_ the prototype for lseek.
+ */
+#if !defined (__WIN32__)
+#include <unistd.h>
+#endif
 #include <stdlib.h>
 #include <time.h>